<!DOCTYPE html>
<html lang="en" xmlns:th="http://www.thymeleaf.org">
<head>
  <meta charset="UTF-8">
  <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
  <title>余额充值</title>
  <link rel="stylesheet" href="mobile/layui/css/layui.mobile.css">
  <link rel="stylesheet" href="mobile/layui/css/layui.css">
  <link rel="stylesheet" href="mobile/css/yj_css.css">



</head>
<body>
  <header class="yj-header">
    <a href="javascript:history.go(-1)" class="yj-header-return layui-icon">&#xe603;</a>
    <span>我的订单</span>
    <a class="yj-header-meau"></a>
  </header>
  <div class="yj-content">
    <div class="yj-recharge yj-bgfff yj-padding yj-margin">
      <p class="yj-padding yj-text-center yj-color-gray yj-recharge-title">充值金额</p>
      <ul class="yj-padding yj-recharge-money layui-row layui-col-space10">
        <li class="layui-col-xs6 yj-active">
          <div class="yj-recharge-item">
            <span class="yj-recharge-discount">10折</span>
            <div class="yj-recharge-select yj-text-center" onclick="money(10.0)">
              10.00元<br>
            </div>
            <input class="yj-none" type="radio" name="recharge">
          </div>
        </li>
        <li class="layui-col-xs6">
          <div class="yj-recharge-item">
            <span class="yj-recharge-discount">10折</span>
            <div class="yj-recharge-select yj-text-center" onclick="money(20.0)">
              20.00元<br>
            </div>
            <input class="yj-none" type="radio" name="recharge">
          </div>
        </li>
        <li class="layui-col-xs6">
          <div class="yj-recharge-item">
            <span class="yj-recharge-discount">10折</span>
            <div class="yj-recharge-select yj-text-center" onclick="money(30.0)">
              30.00元<br>
            </div>
            <input class="yj-none" type="radio" name="recharge">
          </div>
        </li>
        <li class="layui-col-xs6">
          <div class="yj-recharge-item">
            <span class="yj-recharge-discount">10折</span>
            <div class="yj-recharge-select yj-text-center" onclick="money(50.0)">
              50.00元<br>
            </div>
            <input class="yj-none" type="radio" name="recharge">
          </div>
        </li>
      </ul>
    </div>

    <div class="yj-recharge yj-bgfff yj-padding yj-margin">
      <p class="yj-padding yj-text-center yj-color-gray yj-recharge-title">请选择充值方式</p>
      <ul class="yj-padding layui-row layui-col-space10">
        <li class="layui-col-xs6 yj-active">
          <div class="yj-recharge-type">
            <img class="yj-recharge-type-pic" src="mobile/images/alipayPay.png" width="100%">
            <input class="yj-none" type="radio" name="type">
          </div>
        </li>
        <li class="layui-col-xs6">
          <div class="yj-recharge-type">
            <img class="yj-recharge-type-pic" src="mobile/images/wechatPay.png" width="100%">
            <input class="yj-none" type="radio" name="type">
          </div>
        </li>
      </ul>
    </div>


    <div class="yj-recharge-btn">
      <button class="layui-btn layui-btn-fluid layui-btn-radius yj-bg-main" type="button" id="invesert">充值</button>
    </div>

  </div>
  

  <!--<script src="http://libs.baidu.com/jquery/1.11.1/jquery.min.js"></script>-->
  <script th:src="@{/mobile/js/jquery.min.js}"></script>
  <script th:src="@{/mobile/layui/layui.js}"></script>

    <script th:inline="javascript">
    var url = [[@{/}]];
      layui.use("layer", function () {
        var layer = layui.layer;
      });
    </script>

  <script>
    $(".yj-recharge-select").click(function(){

      $(this).siblings("input").click();
      $(this).parents("li").addClass("yj-active");
      $(this).parents("li").siblings("li").removeClass("yj-active");

    });

    var invesert = 10;
    function money(num){
        invesert = num;
    }

    $("#invesert").click(function () {

      $.ajax({
        url:url+"/alipay/goAlipay",
        type:"get",
        data:{
          money:invesert
        },
        success:function (resutlt) {

        document.write(resutlt);
      }
      })
    })

    $(".yj-recharge-type-pic").click(function(){
      $(this).siblings("input").click();
      $(this).parents("li").addClass("yj-active");
      $(this).parents("li").siblings("li").removeClass("yj-active");
    });
  </script>
</body>
</html>